#!/usr/bin/env python

from file_manager_class import FileManager

def init ( l, admin = 0 ):
	from liwe import parts

	f = FileManager ( l )
	
	l.layman.add_js ( "modules/file_manager/js/file_manager.js" )
	l.layman.add_js ( "modules/file_manager/js/file_manager_browser.js" )
	l.layman.add_js ( "modules/file_manager/js/file_manager.form5.js" )
	l.layman.add_css ( "modules/file_manager/gfx/style.css" )

	l.layman.add_js_code ( "file_manager.init();" )

	parts.add ( l.layman, [ "ext" ] )
	parts.add_wwl ( l.layman, [ "tree" ] )

	if admin and int ( admin ):
		l.layman.add_js ( "modules/file_manager/js/file_manager.admin.js" )
		l.layman.add_js_code ( "file_manager.admin.init();" )

	return ''
